package com.easymin.weixin.manager;

import com.easymin.weixin.common.DataGrid;
import com.easymin.weixin.controller.v4.ResultTransport;
import com.easymin.weixin.entity.zhuanche.Order;

import java.util.Map;

public interface ZhuancheManager {

  /**
   * 下单方法.
   */
  Map<String, Object> createOrder(Long passengerId, String passengerName, String passengerPhone,
      String showPhone, Long companyId, String companyName, Long carTypeId, String channelName,
      String startAddress, String startAddressDetail, Double startLat, Double startLng,
      String endAddress, String endAddressDetail, Double endLat, Double endLng, Long serverTime,
      Long couponId, Double budgetPay, Double startPrice, Double mileagePrice, Double runTimePrice,
      Integer travelTime, Double mileage, Boolean zhuanchePrePay, String appKey, String addressUrl)
      throws Exception;

  /**
   * 评价订单.
   */
  String review(Long orderId, Double score, String content, String appKey);

  // 根据条件查询订单
  DataGrid<Map<String, Object>> findByParam(Long passengerId, Integer page, Integer rows,
      String status, String appKey);

  Map<String, Object> update(String address, Long orderId, Long employId, String employName,
      String employPhone, Long employCompanyId, String employNo, String employPhoto,
      Double employScore, String action, String operator, String cause, String appKey);

  String hasten(Long orderId, String appKey);

  Order findOne(Long orderId, String appKey) throws Exception;

  Map<String, Object> findOrder(String address, Long orderId, String appKey) throws Exception;

  // V4查询单个订单
  ResultTransport findOneV4(Long orderId, String address, String appKey);

  // V4接单
  ResultTransport jiedan(Long orderId, Long employId, String appKey, String serverUrl);
  
  ResultTransport yuyueDriverDo(Long orderId, Long employId, String appKey, String serverUrl);

  ResultTransport refuse(
      Long orderId, Long employId, String cause, String employName, String appKey);

  ResultTransport queryTypeV4(Long companyId, String appKey);

  ResultTransport waitV4(Long orderId, String employName, String appKey, String serverUrl);

  ResultTransport runV4(Long orderId, String operator, String appKey,
      String realStartAddress,Double realStartLat,Double realStartLng);

  ResultTransport grabV4(Long orderId, Long employId, String employName, String employPhone,
      Long companyId, String employAccount, String employPhoto, Double employScore,
      String operator, Long rentCompanyId, String rentCompanyName, String appKey);

  ResultTransport createmoreV4(String passengerPhone, Long carTypeId, String startAddress,
      Double startLat, Double startLng, Long employId, String employName, String employPhone,
      Long companyId, String appKey);

  ResultTransport queryOneType(Long carTypeId, String appKey);

  ResultTransport updateToPlace(Long orderId, String toPlace, Double longitude, Double latitude,
      String appKey);
  
  ResultTransport findByParamsInBook(Integer page, Integer rows, Double latitude,Double longitude, String serverUrl, Integer carTypeId, String appKey);
  
  ResultTransport countByParamsInBook(Double latitude,Double longitude, String serverUrl, Integer carTypeId, String appKey);
}
